package com.lcf.demo;

public class Calculation {
    //    定义行为
    public double getAdd(double num1, double num2) {
        return num1 + num2;
    }

    public double getSub(double num1, double num2) {
        return num1 - num2;
    }

    public double getTimes(double num1, double num2) {
        return num1 * num2;
    }

    public double getDiv(double num1, double num2) {
        if (num2 == 0) {
            System.out.println("您输入的数据不合法 ");
        }
        return num1 / num2;
    }
}













